import React, { Component } from "react";

export default class App extends Component {
  render() {
    const obj = {
      color: "red",
      fontSize: 50,
      height: 100,
      border: "1px solid blue", //在字符串中使用要加px
      lineHeight: "100px", //行高不设置px会变成倍数
    };
    return (
      //该写法是错误的,不能直接设置为字符串
      // <div style='color:red'>App123</div>
      //不能直接这么设置,因为 {js表达式}
      // <div style={color:red;}>App123</div>
      //{{}}不是vue中的双大括号,而是一个正常的js对象
      <>
        <div style={{ color: "red" }}>App123</div>
        <div style={obj}>App123</div>
      </>
    );
  }
}
